import Vuex from 'vuex';
import Vue from 'vue';
import createPersistedState from "vuex-persistedstate";
Vue.use(Vuex);

export default new Vuex.Store({
    plugins: [createPersistedState()],
    state: {
        phone: '18376010720',
        token: '',
        addr:[],
    },
    // 同步修改
    mutations: {
        set_phone(state, payload) {
            state.phone = payload;
        },
        set_token(state, payload) {
            state.token = payload;
        },
        set_addr(state, payload) {
            state.addr = payload;
        }
    },
})